package com.yf.controller.web;

import com.beecloud.common.CommonAttributes;
import com.beecloud.common.ResponseError;
import com.yf.form.GPSHistoryForm;
import com.yf.form.VehicleEventForm;
import com.yf.form.VehicleForm;
import com.yf.model.*;
import com.yf.model.pagemodel.GPSHistoryPage;
import com.yf.model.pagemodel.VehicleEventPage;
import com.yf.model.pagemodel.VehiclePage;
import com.yf.pagination.PageParams;
import io.swagger.annotations.*;
import org.springframework.http.ResponseEntity;

/**
 * @author wangbiao
 * @date 2016-08-18 15：13
 */
@Api(tags = "车辆接口",description ="车辆管理", value = "vehicle")
public interface IVehicleController {

    @ApiOperation(value = "根据车牌获取车辆信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", required = true, name = "plate", value = "车牌")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆信息", response = Vehicle.class),
            @ApiResponse(code = 500, message = "车辆未找到")
    })
    ResponseEntity<Vehicle> plate(String plate);

    @ApiOperation(value = "根据多个ID号获取车辆列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", required = true, name = "ids", value = "多个车辆ID号，用英文逗号分割")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆列表", response = VehiclePage.class)
    })
    ResponseEntity<VehiclePage> ids(String ids);



    @ApiOperation(value = "车辆列表分页查询",tags = "车辆接口")
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆列表", response = VehiclePage.class)
    })
    ResponseEntity<VehiclePage> list(@ApiParam(value = "车俩查询信息") VehicleForm vehicleForm, @ApiParam(value = "分页查询信息") PageParams pageParams);


    @ApiOperation(value = "车牌列表",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "userId", value = "车主ID")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车牌列表", response = VehiclePage.class)
    })
    ResponseEntity<VehiclePage> plates(Integer userId);

    @ApiOperation(value = "查询单个车辆详情信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", required = true, name = "id", value = "车辆ID")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆信息", response = Vehicle.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";"
                            + CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<Vehicle> id(Integer id);


    @ApiOperation(value = "新增车辆",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", required = true, name = "vehicle", value = "车辆信息")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "新增成功", response = Void.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";"
                            + CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<Void> saveVehicle(Vehicle vehicle);


    @ApiOperation(value = "修改车辆",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", required = true, name = "vehicle", value = "车辆信息")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "修改成功", response = Void.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";"
                            + CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<Void> modifyVehicle(Vehicle vehicle);

    @ApiOperation(value = "删除车辆",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", required = true, name = "id", value = "车辆ID")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "删除车辆成功", response = Void.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";"
                            + CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<Void> removeVehicleById(Integer id);


    @ApiOperation(value = "审核车辆信息",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", required = true, name = "id", value = "车辆ID"),
            @ApiImplicitParam(paramType = "query", required = true, name = "auditStatus", value = "车辆审核状态:UNAUDITED-未审核,AUDIT-审核")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆信息", response = Boolean.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";"
                            + CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<Boolean> checkVehicleInfo(Integer id, String auditStatus);

    @ApiOperation(value = "车辆实时状态信息",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path",required = true, name = "id", value = "车辆ID")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆信息", response = VehicleRealStatus.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";" +
                            ""+ CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<VehicleRealStatus> queryVehicleRealStatus(Integer id);

    @ApiOperation(value = "车辆事件列表分页查询",tags = "车辆接口")
    @ApiResponses({
            @ApiResponse(code = 200, message = "事件列表", response = VehicleEventPage.class)
    })
    ResponseEntity<VehicleEventPage> eventList(@ApiParam(value = "车俩事件查询信息") VehicleEventForm vehicleEventForm, @ApiParam(value = "分页查询信息") PageParams pageParams);

    @ApiOperation(value = "根据时间段和车辆ID获取GPS集合",tags = "车辆接口")
    @ApiResponses({
            @ApiResponse(code = 200, message = "GPS列表", response = GPSHistoryPage.class)
    })
    ResponseEntity<GPSHistoryPage> gps(@ApiParam(value = "GPSHistory查询信息") GPSHistoryForm gpsHistoryForm, @ApiParam(value = "分页查询信息") PageParams pageParams);

    @ApiOperation(value = "查询单个车辆事件详情信息",tags = "车辆接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", required = true, name = "id", value = "车辆事件ID")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "车辆事件信息", response = VehicleEvent.class),
            @ApiResponse(code = 400,
                    message = CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG +";"
                            + CommonAttributes.SYS_ERROR_CODE +":"+CommonAttributes.NOTFOUND_DATA_MSG,
                    response = ResponseError.class
            )
    })
    ResponseEntity<VehicleEvent> queryVehicleEventById(Integer id);
}
